<template>
	<!-- 反馈记录 -->
	<view>
		<myHead title="反馈记录" :right="false"></myHead>
		<view v-if="List.length>0">
			<view class="content" v-for="item in List">
				<view style="display: flex;justify-content: space-between;align-items: center;">
					<view>
						<text class="text">反馈类型：</text>
						<text class="text1">{{item.TypeStr}}</text>
					</view>
					<view>
						<text
							style="border: 1rpx solid #0AC674 ; padding: 14rpx 31rpx;border-radius: 10rpx;color: #0AC674;"
							v-if="item.State==1">已解答</text>
						<text
							style="border: 1rpx solid #3476FE ; padding: 14rpx 31rpx;border-radius: 10rpx;color: #1563FA;"
							v-else> 未回复</text>
					</view>
				</view>
				<view style="margin: 10rpx 0;">
					<text class="text2">反馈时间：</text>
					<text class="text2">{{item.CreatedTime}}</text>
				</view>
				<view class="jianju">
					<text class="text">问题描述：</text>
					<view class="jianju">
						<text class="text1">{{item.Describe }}</text>
					</view>
				</view>
				<view class="album__content" v-if="item.Picture[0] != ''">
					<!-- <text class="text">图片：</text> -->
					<template v-for="itemimge in item.Picture">
						<u-image width="160rpx" height="160rpx" style="margin: 20rpx;" :src="URL+itemimge"
							@click="upLondImg(itemimge)"></u-image>
					</template>

				</view>
				<view v-if="item.ReturnList.length>0" v-for='(itt,index) in item.ReturnList'>
					<view class="jianju">
						<text class="text">回复时间：</text>
						<text class="text1">{{itt.CreatedTime}}</text>
					</view>
					<view class="jianju">
						<text class="text">回复内容：</text>
						<view class="jianju">
							<text class="text1">{{itt.Content }}</text>
						</view>
					</view>
				</view>
			</view>
			<u-loadmore :status="status" :load-text="loadText" />
		</view>

		<view v-else>
			<u-empty mode="data" icon="/static/recruit/index/qsy.png" width="350" marginTop="150">
			</u-empty>
		</view>

	</view>
</template>

<script>
	import myHead from '@/pages/component/baseHead.vue'
	export default {
		data() {
			return {
				title: "反馈记录",
				URL: this.$config.domain.staticUrl,
				albumWidth: 0,
				page: 1,
				size: 10,
				List: [],
				status: "loadmore",
				loadText: {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '实在没有了'
				}
			}
		},
		components: {
			myHead,
		},
		onReachBottom() {
			if (this.status != "nomore") {
				this.ontextdat();
			}
			// setTimeout(() => {
			// }, 2000)
		},

		onShow() {
			this.page = 1,
				this.size = 10
			this.List = []
			this.ontextdat();
		},
		methods: {
			upLondImg(ee) {
				// 预览图片
				uni.previewImage({
					urls: [this.URL + ee],
				})
			},
			ontextdat() {
				this.status = "loading";
				let obj = {
					"PageIndex": this.page,
					"PageSize": this.size
				}
				const app = getApp();
				let zhuangtai = app.globalData.userRole;
				if (zhuangtai == 0) {
					this.$http.huirc.feedbackUserList(obj).then(res => {
						let dates = res.Result.Items
						dates.forEach(resitem => {
							if (resitem.Picture.indexOf(',')) {
								resitem.Picture = resitem.Picture.split(',');
							} else {
								resitem.Picture = []
								resitem.Picture.split(resitem.Picture)
							}
						})
						this.List = this.List.concat(dates);
						if (dates.length == this.size) {
							this.page++;
						} else {
							this.status = "nomore";
						}
					})
				} else {
					this.$http.huirc.feedbackCorpList(obj).then(res => {
						let dates = res.Result.Items
						dates.forEach(resitem => {
							if (resitem.Picture.indexOf(',')) {
								resitem.Picture = resitem.Picture.split(',');
							} else {
								resitem.Picture = []
								resitem.Picture.split(resitem.Picture)
							}
						})
						this.List = this.List.concat(dates);
						if (dates.length == this.size) {
							this.page++;
						} else {
							this.status = "nomore";
						}
					})
				}

			}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		margin-top: 30rpx;
		padding: 30rpx;
		background: #FFFFFF;

		.album__content {
			margin-top: 40rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			flex-wrap: wrap;
		}
	}

	.jianju {
		margin: 20rpx 0;
	}

	.text {
		font-size: 32rpx;
		font-weight: bold;
		color: #000000;
	}

	.text1 {
		font-size: 32rpx;
		color: #444444;
		font-weight: bold;
	}

	.text2 {
		font-size: 26rpx;
		font-weight: 400;
		color: #999999;
	}
</style>